package priv.menguer.servicelocator.controller;

import priv.menguer.servicelocator.service.impl.Service1;
import priv.menguer.servicelocator.service.impl.Service2;

/**
 * @Title InitialContext.java
 * @description TODO
 * @time 2018年10月26日 下午2:46:48
 * @author menguer@126.com
 * @version 1.0
 */
public class InitialContext {
	public Object lookup(String jndiName) {
		if (jndiName.equalsIgnoreCase("SERVICE1")) {
			System.out.println("Looking up and creating a new Service1 object");
			return new Service1();
		} else if (jndiName.equalsIgnoreCase("SERVICE2")) {
			System.out.println("Looking up and creating a new Service2 object");
			return new Service2();
		}
		return null;
	}
}
